package com.atguigu.functions;

import com.atguigu.bean.WaterSensor;
import org.apache.flink.api.common.functions.FilterFunction;

/**
 * @author gmd
 * @desc FilterFunction接口实现类，自定义Filter过滤算子的业务逻辑。过滤指定ID的数据
 * @since 2024-11-24 10:33:13
 */
public class FilterFunctionImpl implements FilterFunction<WaterSensor> {

    public String id;

    public FilterFunctionImpl(String id) {
        this.id = id;
    }

    @Override
    public boolean filter(WaterSensor value) throws Exception {
        return this.id.equals(value.getId());
    }

}
